//
//  ShowMoreViewController.m
//  TodatPlay
//
//  Created by dllo on 16/9/19.
//  Copyright © 2016年 DM.C. All rights reserved.
//

#import "ShowMoreViewController.h"
#import "ShowMoreTableViewCell.h"
#import "UIImageView+WebCache.h"
#import "HotSearchRootClass.h"
#import "HotSerchOrglist.h"
#import "HostTableViewCell.h"

#define kTableViewCellReuse @"reuse"
@interface ShowMoreViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *showMoreTableView;

@end

@implementation ShowMoreViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    [self.showMoreTableView registerNib:[UINib nibWithNibName:@"HostTableViewCell" bundle:nil] forCellReuseIdentifier:kTableViewCellReuse];
    self.showMoreTableView.tableFooterView = [UIView new];
}

- (void)setOrglistArr:(NSArray<HotSerchOrglist *> *)orglistArr {
    _orglistArr = orglistArr;
    [self.showMoreTableView reloadData];
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return _orglistArr.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    HostTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kTableViewCellReuse];
    HotSerchOrglist *orglist = _orglistArr[indexPath.row];
    [cell.picImageView sd_setImageWithURL:[NSURL URLWithString:orglist.avatar] placeholderImage:[UIImage imageNamed:@"wode_morentouxiang"]];
    cell.nameLabel.text = orglist.name;
    return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 50;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
